package com.dingding.service.activity.core.sql;

/**
 * @ClassName: ActivitySQL
 * @Description: 活动操作表
 * @author YHQ
 * @date 2016年4月14日 下午4:47:40
 */
public class ActivitySQL {

	/**
	 * 重置无效活动
	 * 
	 * @author YHQ
	 * 
	 */
	public static final String RESET_INVALID_ACTIVITY = "UPDATE activity SET snSatatus = 2 WHERE TO_DAYS(NOW()) - TO_DAYS(endTime) > 0";

	/**
	 * 根据邀请码获取优惠券信息
	 */
	public static final String GET_COUPON_INFO = "SELECT c.couponId,co.couponType,co.couponMoney FROM couponrelactivity c LEFT JOIN coupon co ON c.couponId = co.cpId WHERE co.couponStatus = 1 AND c.activityId = ?";

	/**
	 * 获取共享计划列表
	 */
	public static final String GET_SHARE_PLANE_LIST = "SELECT ac.snId AS activityId,ac.createTime AS createTime,ac.propagandaImage AS banner,ac.navigationTitle AS title,ac.propagandaContent AS content FROM shareplan sp "
			+ "INNER JOIN activity ac ON sp.acId = ac.snId " 
			+ "WHERE sp.cityNo = ? ";
}
